/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "sex")
@NamedQueries({
    @NamedQuery(name = "Sex.findAll", query = "SELECT s FROM Sex s"),
    @NamedQuery(name = "Sex.findByIdsex", query = "SELECT s FROM Sex s WHERE s.idsex = :idsex"),
    @NamedQuery(name = "Sex.findBySex", query = "SELECT s FROM Sex s WHERE s.sex = :sex")})
public class Sex implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idsex")
    private Integer idsex;
    @Basic(optional = false)
    @Column(name = "sex")
    private String sex;
    @OneToMany(mappedBy = "sex", fetch = FetchType.LAZY)
    private List<Occurrenceelement> occurrenceelementList;

    public Sex() {
    }

    public Sex(Integer idsex) {
        this.idsex = idsex;
    }

    public Sex(Integer idsex, String sex) {
        this.idsex = idsex;
        this.sex = sex;
    }

    public Integer getIdsex() {
        return idsex;
    }

    public void setIdsex(Integer idsex) {
        this.idsex = idsex;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public List<Occurrenceelement> getOccurrenceelementList() {
        return occurrenceelementList;
    }

    public void setOccurrenceelementList(List<Occurrenceelement> occurrenceelementList) {
        this.occurrenceelementList = occurrenceelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idsex != null ? idsex.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sex)) {
            return false;
        }
        Sex other = (Sex) object;
        if ((this.idsex == null && other.idsex != null) || (this.idsex != null && !this.idsex.equals(other.idsex))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Sex[idsex=" + idsex + "]";
    }

}
